<template>
  <div class="mode-wrap">
    <div class="mode-head">
      <el-radio-group v-model="type">
        <el-radio-button :label="1">企业模板库（6/1000）</el-radio-button>
        <el-radio-button :label="2">个人模板库（0/1000）</el-radio-button>
      </el-radio-group>
      <div class="search-rows">
        <el-input class="search-input" size="small" placeholder="请输入关键词" suffix-icon="el-icon-search" />
        <el-select v-model="value" placeholder="状态" size="small">
          <el-option v-for="item in accountList" :key="item.value" :label="item.label" :value="item.value">
          </el-option>
        </el-select>
      </div>
    </div>
    <div class="mode-list">
      <div class="card create-mode" @click="onNavigationTo('/single/sop/template')" v-hasPermi="['singleModel:add']">
        <div>
          <i class="el-icon-plus icon"></i>
          <div>创建模版</div>
        </div>
      </div>
      <div class="card" v-for="i in 6" :key="i">
        <div class="card-body">
          <div class="card-title">
            <div class="title-text">11111</div>
          </div>
          <div class="card-text"><label>最近更新：</label>2024.03.14 09:22</div>
          <div class="card-text"><label>模板类型：</label><span style="color: rgb(48, 112, 255);">标准模板</span></div>
          <div class="card-text"><label>退订功能：</label><span style="color: rgb(51, 112, 255);">开启</span></div>
        </div>
        <div class="card-footer">
          <div v-hasPermi="['singleModel:edit']">编辑</div>
          <div class="borde-left">
            <el-dropdown>
              <span v-hasPermi="['singleModel:copy']">复制</span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>复制到企业模版库</el-dropdown-item>
                <el-dropdown-item>复制到个人模板库</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </div>
          <div class="borde-left" v-hasPermi="['singleModel:del']">删除</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      type: 1
    }
  },
  methods: {
    onNavigationTo(path) {
      this.$router.push(path)
    },
  }
}
</script>
<style lang="scss" scoped>
.mode-wrap {
  font-size: 14px;
  line-height: 22px;
  padding-right: 12px;
  .mode-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    .search-rows {
      display: grid;
      column-gap: 8px;
      grid-template-columns: 200px 200px;
    }
  }
  .mode-list {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-gap: 10px;
    .card {
      height: 179px;
      background: #fff;
      border-radius: 2px;
      border: 1px solid #e9e9e9;
      color: #666;
      cursor: pointer;
      transition: all .3s;
      &:hover {
        color: #2f54eb;
        border-color: #2f54eb;
        box-shadow: 0 9px 28px 8px rgba(47,84,235,.05),0 6px 16px 0 rgba(47,84,235,.08),0 3px 6px -4px rgba(47,84,235,.12)
      }
      &.create-mode {
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        .icon {
          font-size: 23px;
          margin-bottom: 6px;
        }
      }
      .card-body {
        padding: 16px 0 13px 16px;
        .card-title {
          margin-bottom: 12px;
          display: flex;
          align-items: center;
          .title-text {
            font-weight: 700;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            color: rgba(0, 0, 0, .85);
            width: 100%;
            padding-right: 5px;
          }
        }
        .card-text {
          height: 22px;
          line-height: 22px;
          font-size: 12px;
          color: rgba(0, 0, 0, .85);
          &:not(:first-child) {
            margin-top: 4px;
          }
          label {
            color: #666;
            width: 60px;
            display: inline-block;
            text-align: right;
            font-weight: 400;
          }
        }
      }
      .card-footer {
        display: flex;
        border-top: 1px solid #e9e9e9;
        background-color: #f5f5f5;
        height: 40px;
        div {
          flex: 1 1;
          display: flex;
          padding: 9px 0;
          align-items: center;
          justify-content: center;
          color: #666;
          transition: all .3s;
        }
        .borde-left {
          border-left: 1px solid #e9e9e9;
        }
      }
    }
  }
}
</style>
